package com.caojing.hlm.home;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.caojing.hlm.R;
import com.caojing.hlm.view.MyListView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class HomeFragment extends Fragment {


    @Bind(R.id.home_fragment_search)
    LinearLayout homeFragmentSearch;
    @Bind(R.id.home_fragment_vp)
    ViewPager homeFragmentVp;
    @Bind(R.id.home_fragment_tv_comment)
    TextView homeFragmentTvComment;
    @Bind(R.id.home_fragment_lv)
    MyListView homeFragmentLv;
    @Bind(R.id.home_fragment_scrollview)
    ScrollView homeFragmentScrollview;

    public HomeFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_home, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick({R.id.home_fragment_search, R.id.home_fragment_tv_comment})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.home_fragment_search:
                startActivity(new Intent(getActivity(),SearchActivity.class));
                break;
            case R.id.home_fragment_tv_comment:
                break;
        }
    }
}
